﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UserControl_Admin/MasterPage_Admin.Master"
    AutoEventWireup="true" CodeBehind="ChiTietSanPham_Admin.aspx.cs" Inherits="TMDT_Nhom1A.Administrator.ChiTietSanPham_Admin" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="tk" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="module_round_box_inner">
        <div class="module_round_box_inner2">
            <div class="s5_mod_h3_1">
                <div class="s5_mod_h3_2">
                    <h3 class="s5_mod_h3">
                        <span class="s5_h3_first">Chi tiết sản phẩm </span>
                    </h3>
                </div>
            </div>
            <tk:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
            </tk:ToolkitScriptManager>
            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
                    <asp:Panel ID="pncatalogue" Visible="false" runat="server" HorizontalAlign="Center"
                        Style="padding-bottom: 5px; padding-top: 5px">
                        <div>
                            Nhóm sản phẩm chính :
                            <asp:DropDownList ID="dlparentcatalogue" runat="server" OnSelectedIndexChanged="dlparentcatalogue_SelectedIndexChanged"
                                AutoPostBack="True">
                            </asp:DropDownList>
                        </div>
                        <div>
                            Nhóm sản phẩm :
                            <asp:DropDownList ID="dlchildrencatalogue" runat="server">
                            </asp:DropDownList>
                        </div>
                    </asp:Panel>
                    <asp:DataList ID="dldetailproduct" runat="server" Width="100%" 
                        OnItemCommand="dldetailproduct_ItemCommand" 
                        onitemdatabound="dldetailproduct_ItemDataBound">
                        <ItemTemplate>
                            <table border="0" style="width: 100%;">
                                <tbody>
                                    <tr>
                                        <td width="33%" rowspan="4" valign="top">
                                            <br>
                                            <a href='<%# Eval("ImagePath","../images/{0}.jpg")%>' alt='<%# Eval("ElectricDevice_ID") %>'
                                                title='<%# Eval("ElectricDevice_ID") %>'>
                                                <asp:Image ID="Image1" runat="server" Height="150" Width="150" ImageUrl='<%# Eval("ImagePath","../images/{0}.jpg")%>'
                                                    alt='<%# Eval("ElectricDevice_ID") %>' border="0" />
                                            </a>
                                            <br>
                                        </td>
                                        <td rowspan="1" colspan="2">
                                            <h1>
                                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("ElectricDevice_ID") %>'></asp:Label>
                                            </h1>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="33%" valign="top" align="left">
                                            <strong>Giá bán lẽ: </strong><span class="productPrice">
                                                <asp:Label ID="lbRetailPrice" runat="server" ForeColor="Red" Font-Bold="true" Text='<%# Eval("RetailPrice") %>'></asp:Label>
                                            </span>
                                            <asp:Label ID="lbcurrency" runat="server" Text='<%# Eval("Currency_ID") %>'></asp:Label>
                                            <br>
                                            <strong>Giá bán sĩ: </strong><span class="productPrice">
                                                <asp:Label ID="Label6" runat="server" ForeColor="Red" Font-Bold="true" Text='<%# Eval("DealerPrice") %>'></asp:Label>
                                            </span>
                                            <asp:Label ID="Label8" runat="server" Text='<%# Eval("Currency_ID") %>'></asp:Label>
                                            <br>
                                            <div class="vmCartContainer">
                                                <div style="float: left; vertical-align: middle;">
                                                    <label for="quantity181" class="quantity_box">
                                                        Số lượng:&nbsp;</label>
                                                    <asp:TextBox ID="tbquantity" Width="40px" CssClass="inputboxquantity" runat="server"></asp:TextBox>
                                                    <tk:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" TargetControlID="tbquantity"
                                                        FilterType="Numbers" runat="server">
                                                    </tk:FilteredTextBoxExtender>
                                                    <%--<asp:ImageButton ID="ImageButton1" runat="server" OnClick="var qty_el = document.getElementById('tbquantity'); var qty = qty_el.value; if( !isNaN( qty )) qty_el.value++;return false;" />
                                    <asp:ImageButton ID="ImageButton2" runat="server" OnClick="var qty_el = document.getElementById('tbquantity'); var qty = qty_el.value; if( !isNaN( qty ) &amp;&amp; qty &gt; 0 ) qty_el.value--;return false;" />--%>
                                                    <asp:Button ID="Button1" CommandName="AddToCart" CssClass="addtocart_button" runat="server"
                                                        Text="Thêm vào Giỏ" />
                                                </div>
                                            </div>
                                        </td>
                                        <!--    <td valign="top"><br /></td>-->
                                    </tr>
                                    <tr>
                                        <td>
                                            <a target="_blank" href="https://www.baokim.vn/payment/customize_payment/product?business=ankomart.com@gmail.com&amp;product_name=&gt;8336-800&amp;product_price=

	
		6350000			


&amp;product_quantity=1&amp;total_amount=

	
		6350000			


">
                                                <img src="../images/baokim.png" alt="Thanh toán an toàn vo+'i Ba?o Kim !" border="0"
                                                    title="Thanh toán trực tuyến an toàn dùng tài khoản Ngân hàng (VietcomBank, TechcomBank, Đông Á, VietinBank, Quân Đội, VIB, SHB,... và thẻ Quốc tế (Visa, Master Card...) qua Cổng thanh toán trực tuyến BảoKim.vn">
                                            </a>&nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <a href="https://www.baokim.vn/payment_guide/ankomart.html" target="_blank">[Hướng dẫn
                                                thanh toán]</a>
                                        </td>
                                    </tr>
                                    <!-- <tr>
	  <td colspan="2"><a class="button" href="/index.php?option=com_virtuemart&amp;Itemid=231&amp;category_id=13&amp;flypage=flypage.tpl&amp;lang=vi&amp;page=shop.ask&amp;product_id=181">Ask a question about this product</a></td>
	</tr> -->
                                    <tr>
                                        <td rowspan="1" colspan="2">
                                            <hr>
                                            <table width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
                                                <tbody>
                                                    <tr>
                                                        <td class="ProBody2">
                                                            <strong>Hãng : </strong>
                                                            <asp:Label ID="Label7" runat="server" Text='<%# Eval("Brand_Name") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="ProBody2">
                                                            <strong>Số lượng : </strong>
                                                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("Quantity") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="ProBody2">
                                                            <strong>Chất lượng : </strong>
                                                            <asp:Label ID="Label3" runat="server" Text='<%# Eval("Quanlity") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="ProBody2">
                                                            <strong>Kích thước : </strong>
                                                            <asp:Label ID="Label4" runat="server" Text='<%# Eval("Size") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="ProBody2">
                                                            <strong>Mô tả : </strong>
                                                            <asp:Label ID="Label5" runat="server" Text='<%# Eval("Description") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                            <br>
                                            <span style="font-style: italic;"></span>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <div style="margin-left: 500px">
                                <asp:ImageButton ID="Edit" CommandName="Edit" ImageUrl="~/images/page-edit-icon.png"
                                    runat="server" />
                                <asp:ImageButton ID="Delete" CommandName="Delete" ImageUrl="~/images/delete-icon.png"
                                    runat="server" />
                            </div>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <table border="0" style="width: 100%;">
                                <tbody>
                                    <tr>
                                        <td width="33%" rowspan="4" valign="top">
                                            <br>
                                            <asp:FileUpload ID="FileUpload1" runat="server" />
                                            <br>
                                        </td>
                                        <td rowspan="1" colspan="2">
                                            <h1>
                                                <asp:TextBox ID="tbelectricdeviceid" runat="server" Text='<%# Eval("ElectricDevice_ID") %>'></asp:TextBox>
                                            </h1>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="33%" valign="top" align="left">
                                            <strong>Giá: </strong><span class="productPrice">
                                                <asp:Label ID="lbRetailPrice" runat="server" Text='<%# Eval("RetailPrice") %>'></asp:Label>
                                            </span><span class="productPrice">
                                                <asp:Label ID="lbDealerPrice" runat="server" Text='<%# Eval("DealerPrice") %>'></asp:Label>
                                            </span>
                                            <br>
                                            <div class="vmCartContainer">
                                                <div style="float: left; vertical-align: middle;">
                                                    <label for="quantity181" class="quantity_box">
                                                        Số lượng:&nbsp;</label>
                                                    <asp:TextBox ID="tbquantityedit" Width="40px" CssClass="inputboxquantity" runat="server"></asp:TextBox>
                                                    <tk:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" TargetControlID="tbquantityedit"
                                                        FilterType="Numbers" runat="server">
                                                    </tk:FilteredTextBoxExtender>
                                                    <%--<asp:ImageButton ID="ImageButton1" runat="server" OnClick="var qty_el = document.getElementById('tbquantity'); var qty = qty_el.value; if( !isNaN( qty )) qty_el.value++;return false;" />
                                    <asp:ImageButton ID="ImageButton2" runat="server" OnClick="var qty_el = document.getElementById('tbquantity'); var qty = qty_el.value; if( !isNaN( qty ) &amp;&amp; qty &gt; 0 ) qty_el.value--;return false;" />--%>
                                                    <asp:Button ID="Button1" CommandName="AddToCart" CssClass="addtocart_button" runat="server"
                                                        Text="Thêm vào Giỏ" />
                                                </div>
                                            </div>
                                        </td>
                                        <!--    <td valign="top"><br /></td>-->
                                    </tr>
                                    <tr>
                                        <td>
                                            <a target="_blank" href="https://www.baokim.vn/payment/customize_payment/product?business=ankomart.com@gmail.com&amp;product_name=&gt;8336-800&amp;product_price=

	
		6350000			


&amp;product_quantity=1&amp;total_amount=

	
		6350000			


">
                                                <img src="../images/baokim.png" alt="Thanh toán an toàn vo+'i Ba?o Kim !" border="0"
                                                    title="Thanh toán trực tuyến an toàn dùng tài khoản Ngân hàng (VietcomBank, TechcomBank, Đông Á, VietinBank, Quân Đội, VIB, SHB,... và thẻ Quốc tế (Visa, Master Card...) qua Cổng thanh toán trực tuyến BảoKim.vn">
                                            </a>&nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <a href="https://www.baokim.vn/payment_guide/ankomart.html" target="_blank">[Hướng dẫn
                                                thanh toán]</a>
                                        </td>
                                    </tr>
                                    <!-- <tr>
	  <td colspan="2"><a class="button" href="/index.php?option=com_virtuemart&amp;Itemid=231&amp;category_id=13&amp;flypage=flypage.tpl&amp;lang=vi&amp;page=shop.ask&amp;product_id=181">Ask a question about this product</a></td>
	</tr> -->
                                    <tr>
                                        <td rowspan="1" colspan="2">
                                            <hr>
                                            <table width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
                                                <tbody>
                                                    <tr>
                                                        <td class="ProBody2">
                                                            <strong>Hãng : </strong>
                                                            <asp:DropDownList ID="dlbrand" runat="server">
                                                            </asp:DropDownList>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="ProBody2">
                                                            <strong>Số lượng : </strong>
                                                            <asp:TextBox ID="tbquantity" runat="server" Text='<%# Eval("Quantity") %>'></asp:TextBox>
                                                            <tk:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" TargetControlID="tbquantity"
                                                                FilterType="Numbers" runat="server">
                                                            </tk:FilteredTextBoxExtender>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="ProBody2">
                                                            <strong>Chất lượng : </strong>
                                                            <asp:TextBox ID="tbquanlity" runat="server" Text='<%# Eval("Quanlity") %>'></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="ProBody2">
                                                            <strong>Kích thước : </strong>
                                                            <asp:TextBox ID="tbsize" runat="server" Text='<%# Eval("Size") %>'></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="ProBody2" valign="top">
                                                            <strong>Mô tả : </strong>
                                                            <asp:TextBox ID="tbdescription" TextMode="MultiLine" runat="server" Text='<%# Eval("Description") %>'
                                                                Height="100px" Width="200px"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                            <br>
                                            <span style="font-style: italic;"></span>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <div style="margin-left: 500px">
                                <asp:ImageButton ID="btUpdate" CommandName="Update" ImageUrl="~/images/post-accept-icon.png"
                                    runat="server" />
                                <asp:ImageButton ID="btCancel" CommandName="Cancel" ImageUrl="~/images/post-delete-icon.png"
                                    runat="server" />
                            </div>
                        </EditItemTemplate>
                    </asp:DataList>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="module_round_box_inner">
                <div class="module_round_box_inner2">
                    <div class="s5_mod_h3_1">
                        <div class="s5_mod_h3_2">
                            <h3 class="s5_mod_h3">
                                <span class="s5_h3_first">Thông tin coupon</span>
                            </h3>
                        </div>
                    </div>
                    <table width="100%">
                        <tr>
                            <td style="width: 50%">
                                Ngày :
                                <asp:TextBox ID="tbdate" runat="server"></asp:TextBox>
                                <tk:CalendarExtender ID="CalendarExtender1" TargetControlID="tbdate" runat="server">
                                </tk:CalendarExtender>
                                <asp:Label ID="lbcouponid" Visible="false" runat="server"></asp:Label>
                            </td>
                            <td style="width: 50%">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%">
                                Ngày bắt đầu bán :
                                <asp:TextBox ID="tbtimetostartselling" runat="server"></asp:TextBox>
                                <tk:CalendarExtender ID="CalendarExtender2" TargetControlID="tbtimetostartselling"
                                    runat="server">
                                </tk:CalendarExtender>
                            </td>
                            <td style="width: 50%">
                                Ngày kết thúc bán :
                                <asp:TextBox ID="tbtimetoendselling" runat="server"></asp:TextBox>
                                <tk:CalendarExtender ID="CalendarExtender3" TargetControlID="tbtimetoendselling"
                                    runat="server">
                                </tk:CalendarExtender>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%">
                                Ngày bắt đầu sử dụng :
                                <asp:TextBox ID="tbtimetostartusing" runat="server"></asp:TextBox>
                                <tk:CalendarExtender ID="CalendarExtender4" TargetControlID="tbtimetostartusing"
                                    runat="server">
                                </tk:CalendarExtender>
                            </td>
                            <td style="width: 50%">
                                Ngày kết thúc sử dụng :
                                <asp:TextBox ID="tbtimetoendusing" runat="server"></asp:TextBox>
                                <tk:CalendarExtender ID="CalendarExtender5" TargetControlID="tbtimetoendusing" runat="server">
                                </tk:CalendarExtender>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%">
                                Giá ban đầu :
                                <asp:TextBox ID="tbnondiscountprice" runat="server"></asp:TextBox>
                                <tk:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" TargetControlID="tbnondiscountprice"
                                    FilterType="Numbers" runat="server">
                                </tk:FilteredTextBoxExtender>
                            </td>
                            <td style="width: 50%">
                                Giá khuyến mãi (coupon) :
                                <asp:TextBox ID="tbdiscountprice" runat="server"></asp:TextBox>
                                <tk:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" TargetControlID="tbdiscountprice"
                                    FilterType="Numbers" runat="server">
                                </tk:FilteredTextBoxExtender>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%">
                                Số lượng :
                                <asp:TextBox ID="tbquantityfordiscountprice" runat="server"></asp:TextBox><tk:FilteredTextBoxExtender
                                    ID="FilteredTextBoxExtender1" TargetControlID="tbquantityfordiscountprice" FilterType="Numbers"
                                    runat="server">
                                </tk:FilteredTextBoxExtender>
                            </td>
                            <td style="width: 50%">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%" valign="top">
                                Mô tả :
                                <asp:TextBox ID="tbdescription" runat="server" TextMode="MultiLine" Height="100px"
                                    Width="70%"></asp:TextBox>
                            </td>
                            <td style="width: 50%" valign="top">
                                Điều kiện sử dụng :
                                <asp:TextBox ID="tbusingcondition" runat="server" TextMode="MultiLine" Height="100px"
                                    Width="50%"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%" valign="top">
                            </td>
                            <td style="width: 50%" valign="top">
                                <asp:ImageButton ID="btaddcoupon" ImageUrl="~/images/add-icon.png" runat="server"
                                    OnClick="btaddcoupon_Click" OnClientClick="if(!confirm('Bạn có muốn thêm coupon này không ?')) return false;" />
                                <asp:ImageButton ID="btupdate" Visible="false" ImageUrl="~/images/post-accept-icon.png"
                                    runat="server" OnClick="btupdate_Click" OnClientClick="if(!confirm('Bạn có cập nhật coupon này không ?')) return false;" />
                                <asp:ImageButton ID="btcancel" Visible="false" ImageUrl="~/images/post-delete-icon.png"
                                    runat="server" OnClick="btcancel_Click" OnClientClick="if(!confirm('Bạn có không muốn cập nhật coupon này ?')) return false;" />
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="module_round_box_inner">
                <div class="module_round_box_inner2">
                    <div class="s5_mod_h3_1">
                        <div class="s5_mod_h3_2">
                            <h3 class="s5_mod_h3">
                                <span class="s5_h3_first">Danh sách các coupon</span>
                            </h3>
                        </div>
                    </div>
                    <asp:GridView ID="gvcoupondevice" runat="server" Width="100%" AutoGenerateColumns="False"
                        OnRowDataBound="gvcoupondevice_RowDataBound" OnRowCommand="gvcoupondevice_RowCommand">
                        <Columns>
                            <asp:BoundField HeaderText="Ngày bắt đầu bán" DataField="TimeToStartSelling">
                                <ItemStyle Width="125px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Ngày kết thúc bán" DataField="TimeToEndSelling">
                                <ItemStyle Width="125px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Ngày bắt đầu sử dụng" DataField="TimeToStartUsing">
                                <ItemStyle Width="125px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Ngày kết thúc sử dụng" DataField="TimeToEndUsing">
                                <ItemStyle Width="125px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Số lượng coupon" DataField="QuantityForDiscountPrice">
                                <ItemStyle Width="100px" HorizontalAlign="Center" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Tình trạng">
                                <ItemTemplate>
                                    <asp:Label ID="lbstatus" Visible="false" runat="server" Text='<%# Eval("Status") %>'></asp:Label>
                                    <asp:Label ID="lbinformation" runat="server" Text="Label"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle Width="100px" HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <asp:ImageButton ID="btCheckAll" runat="server" ImageUrl="~/images/Check-icon.png"
                                        CommandName="CheckAll" />
                                    <asp:CheckBox ID="cbCheckAll" Visible="false" Checked="false" runat="server" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbcheck" runat="server" />
                                </ItemTemplate>
                                <ItemStyle Width="50px" HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbselectcoupon" CommandName="SelectCoupon" CommandArgument='<%# Eval("Coupon_ID") %>'
                                        runat="server">Chọn</asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" Width="70px" />
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle CssClass="HeaderGrid" />
                    </asp:GridView>
                    <div style="margin-left: 500px;">
                        <br />
                        <asp:Button ID="btactive" runat="server" Text="Kích hoạt" OnClientClick="if(!confirm('Bạn có muốn kích hoạt hết tất cả không ?')) return false;"
                            OnClick="btactive_Click" />
                        <asp:Button ID="btdisactive" runat="server" Text="Không kích hoạt" OnClientClick="if(!confirm('Bạn có muốn không kích hoạt hết tất cả không ?')) return false;"
                            OnClick="btdisactive_Click" />
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
